Skip to content

[PWGJE] Adding file jetHadronsPID.cxx and it's workflow#16012

Draft
MyFavoriteGitHub wants to merge 11 commits intoAliceO2Group:masterfrom
MyFavoriteGitHub:PID-Hadrons-in-Jets
Draft

[PWGJE] Adding file jetHadronsPID.cxx and it's workflow#16012
MyFavoriteGitHub wants to merge 11 commits intoAliceO2Group:masterfrom
MyFavoriteGitHub:PID-Hadrons-in-Jets

Conversation

@MyFavoriteGitHub
Copy link
Copy Markdown

The reason for this pull request is to create a new analysis of PID in jets as a student's team with the collaboration of Warsaw University of Technology Physics department .
This is the first pull request from this account, I hope all the technical requirements are met.
If you have any questions, please contact me on leonard.lorenc@cern.ch

@github-actions github-actions Bot added the pwgje label Apr 28, 2026
@github-actions github-actions Bot changed the title [PWGJE] Adding file jetHadronsPID.cxx and it's workflow [PWGJE] Adding file jetHadronsPID.cxx and it's workflow Apr 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

O2 linter results: ❌ 15 errors, ⚠️ 2 warnings, 🔕 0 disabled

@MyFavoriteGitHub MyFavoriteGitHub marked this pull request as ready for review April 28, 2026 19:10
@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 29, 2026

@MyFavoriteGitHub your username does not really identify you well in the collaboration.

Comment on lines +29 to +35
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/Logger.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/DCA.h"
#include "ReconstructionDataFormats/PID.h"
#include "ReconstructionDataFormats/Track.h"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the format

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
double px2 = px * px, py2 = py * py, pz2 = pz * pz;
double pz4 = pz2 * pz2;

if (px == 0 && py == 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not compare double to 0.

registryData.add("mc_sec_proton_pt", "Reconstructed Proton Secondaries", HistType::kTH1F, {{120, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}});
}

void getPerpendicularDirections(const TVector3& p, TVector3& u1, TVector3& u2)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put some documentation concerning the purpose of this function and the math involved.

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
u2.SetXYZ(u2x, (-pz2 - px * u2x) / py, pz);
}

double getDeltaPhi(double a1, double a2)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't reinvent the wheel. Use RecoDecay::constrainAngle.

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
}

template <typename TrackIts>
bool hasITSHit(const TrackIts& track, int layer)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate name.

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
bool hasITSHit(const TrackIts& track, int layer)
{
int ibit = layer - 1;
return (track.itsClusterMap() & (1 << ibit));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a bool expression.

}

template <typename JetTrack>
bool passedTrackSelectionForJetReconstruction(const JetTrack& track)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use the central track selection?

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
Comment on lines +699 to +706
bool passTpcPi = (std::abs(track.tpcNSigmaPi()) <= 3.0);
bool passTofPi = track.hasTOF() && (std::abs(track.tofNSigmaPi()) <= 3.0);

bool passTpcKa = (std::abs(track.tpcNSigmaKa()) <= 3.0);
bool passTofKa = track.hasTOF() && (std::abs(track.tofNSigmaKa()) <= 3.0);

bool passTpcPr = (std::abs(track.tpcNSigmaPr()) <= 3.0);
bool passTofPr = track.hasTOF() && (std::abs(track.tofNSigmaPr()) <= 3.0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid hard-coded and duplicated constants.

/// \author Małgorzata Janik malgorzata.janik@cern.ch
/// \author Daniela Ruggiano daniela.ruggiano@cern.ch

#include "PWGJE/Core/JetBkgSubUtils.h"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vkucera can you check the includes please?

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
continue;

fastjet::PseudoJet fourMomentum(track.px(), track.py(), track.pz(), track.energy(MassPionCharged));
fourMomentum.set_user_index(id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably fine but is it the same as using globalIndex()? Probably globalIndex is safer in case at some point you accidentally add a cut before idx++

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
continue;

double normalizedJetArea = jet.area() / (PI * rJet * rJet);
if (applyAreaCut && (!isppRefAnalysis) && normalizedJetArea > maxNormalizedJetArea)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you apply a maximum cut instead of minimum?

if (fjParticles.empty())
return;

fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you not use the common jet finder?

static constexpr double DcaxyMaxTrackPar0 = 0.0105;
static constexpr double DcaxyMaxTrackPar1 = 0.035;
static constexpr double DcaxyMaxTrackPar2 = 1.1;
static constexpr double DcazMaxTrack = 2.0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dca cuts for kets and PID are very different, is this safe?

Comment thread PWGJE/Tasks/jetHadronsPid.cxx Outdated
if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))
return;

for (auto const& mcpart : mcParticles) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this loops over every mc particle in the dataframe, not just the ones associated to the mcCollision matched to that particular collision

@nzardosh nzardosh marked this pull request as draft April 29, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants